package business.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.transaction.annotation.Transactional;

import vo.OpinionType;
import business.OpinionTypeService;
import dao.OpinionTypeDAO;

public class OpinionTypeServiceImpl implements OpinionTypeService {

	private OpinionTypeDAO opinionTypeDao;

	public List<OpinionType> getAll() {
		return opinionTypeDao.findAll();
	}

	@Required
	public void setOpinionTypeDao(OpinionTypeDAO opinionTypeDao) {
		this.opinionTypeDao = opinionTypeDao;
	}

	@Transactional
	public void insert(OpinionType opinionType) {
		opinionTypeDao.create(opinionType);
	}

	@Transactional
	public OpinionType getById(long opinionTypeId) {
		return opinionTypeDao.read(opinionTypeId);
	}
}